import { useState } from "react";
import Screen from "./Screen"

const Computer = () => {
    const [status, setStates] = useState(false);
    const toggle = () => {
        setStates(!status)
    }
    return (
        <div>
            <div>Computer</div>
            <button onClick={toggle}>开关</button>
            {/* 自定义属性 进行 父子组件传值 */}
            <Screen logo="Lucky" showContent={status ? "显示器亮" : "显示器暗"} />
        </div>
    )
}

export default Computer 